package com.cimpm.project.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.hby.common.annotation.entity.AllowNull;
import com.hby.common.annotation.entity.Pattern;
import com.hby.common.annotation.entity.VerifyRepetitionField;
import com.hby.common.typeHandler.DateTypeHandler;

import java.util.Date;

@TableName("project_project")
public class Project {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

	@VerifyRepetitionField
	private String name;

	@VerifyRepetitionField
	private String code;

    @Pattern("^房建|市政|景观|其他$")
	private String type;

	@AllowNull
	private Double cost;

    private String editor;

    @TableField(typeHandler = DateTypeHandler.class)
    private String createTime;

    @TableField(typeHandler = DateTypeHandler.class)
    private String editTime;

    private String creator;

	@AllowNull
	private String summary;

	private String status;

    @TableLogic
    private Date isDeleted;

    @Version
    private Integer version;

    public Integer getId() { return id; }

    public void setId(Integer id) { this.id = id; }

    public String getName() { return name; }

    public void setName(String name) { this.name = name; }

    public String getCode() { return code; }

    public void setCode(String code) { this.code = code; }

    public String getType() { return type; }

    public void setType(String type) { this.type = type; }

    public Double getCost() { return cost; }

    public void setCost(Double cost) { this.cost = cost; }

    public String getEditor() { return editor; }

    public void setEditor(String editor) { this.editor = editor; }

    public String getCreateTime() { return createTime; }

    public void setCreateTime(String createTime) { this.createTime = createTime; }

    public String getEditTime() { return editTime; }

    public void setEditTime(String editTime) { this.editTime = editTime; }

    public String getCreator() { return creator; }

    public void setCreator(String creator) { this.creator = creator; }

    public String getSummary() { return summary; }

    public void setSummary(String summary) { this.summary = summary; }

    public String getStatus() { return status; }

    public void setStatus(String status) { this.status = status; }

    public Date getIsDeleted() { return isDeleted; }

    public void setIsDeleted(Date isDeleted) { this.isDeleted = isDeleted; }

    public Integer getVersion() { return version; }

    public void setVersion(Integer version) { this.version = version; }

    @Override
    public String toString() {
    return "project{" +
            "id=" + id +
            ", name=" + name +
            ", code=" + code +
            ", type=" + type +
            ", cost=" + cost +
            ", editor=" + editor +
            ", createTime=" + createTime +
            ", editTime=" + editTime +
            ", creator=" + creator +
            ", summary=" + summary +
            ", status=" + status +
            ", isDeleted=" + isDeleted +
            ", version=" + version +
            '}';
    }

}
